package com.example.dahua.simplefactory;

/**
 * @author: dangwen
 * @createDate: 2021/1/11
 */
public class OperationDiv extends Operation{
    @Override
    public double getResult() {
        if (getOptionNumberB() == 0) {
            try {
                throw new Exception("除数不能为0");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return getOptionNumberA() / getOptionNumberB();
    }
}
